<!DOCTYPE html>
<html style="background-color:#fff;height:100%">
<head>
    <meta charset="UTF-8">
    <title>专利表单页面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--公用样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css" />
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/it/common/css/style.css" />
    <style>
        .thesis {
            width: 100%;
            height: 100%;
            padding: 0px;
            padding-bottom: 120px;
            overflow-y: auto;
        }
        .thesis label {
            width: 30%!important;
        }
        .thesisbor>div {
            margin: 1% !important;
            padding: 0px 4% !important;
            width: 90% !important;
        }
        .beizhu-div {
            width: 60% !important;
        }
        .beizhu-div textarea{
            width: 100%!important;
        }
        .upload-file-div {
            width: 70%!important;
            padding-left: 2%
        }
        .upload-file-li {
            width: 90% !important;
        }
        .zbamount {
            width: 50% !important;
        }
        .bwamount {
            width: 50% !important;
        }
        .zb-input {
            width: 140px!important;
            padding: 0px 10px!important;
        }
        .iTtable{
            border: 0px;
        }
        .iTtable table input{
            width: 90%!important;
            text-align: center;
        }
        .file-name-span {
            margin-top: 8px!important;
        }
        .thesis input {
            width: 160px!important;
            padding: 0px 0px 0px 10px!important;
        }
        .layui-form-select input{
            width: 170px!important;
        }
        .h34 {
            height: 34px;
        }
        th {
            padding: 10px;
        }
        td {
            padding: 10px;
        }
    </style>
</head>
<body>
<!--新建文件夹-->
<form class="layui-form">
<div class="layui-container" style="margin-top:40px;padding-bottom: 80px">
    <div class="thesis thesisTwo whitebg">
        <div class="ft20 bold">填写专利信息</div>
        <ul class="clearfix">
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">专利名称<span style="color: red">*</span></label>
                <div class="fl">
                    <input type="hidden" name="spfId" value="${formData.spfId}">
                    <input type="text" name="spfF1" value="${formData.spfF1}" lay-maxlength="128" lay-verify="maxlength|required" placeholder="填写专利名称"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">专利类型</label>
                <div class="fl">
                    <select name="spfF2">
                        <#list zllxList as zllx>
                            <option value="${zllx.badtCode}"<#if (zllx.badtCode == formData.spfF2)> selected="selected" </#if>>${zllx.badtName}</option>
                        </#list>
                    </select>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">阶段</label>
                <div class="fl">
                    <select name="spfF3" value="${formData.spfF3}">
                        <#list itjdList as itjd>
                            <option value="${itjd.badtCode}"<#if (itjd.badtCode == formData.spfF3)> selected="selected" </#if>>${itjd.badtName}</option>
                        </#list>
                    </select>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">撰写人</label>
                <div class="fl">
                    <input type="text" name="spfF4" value="${formData.spfF4}" lay-maxlength="128" lay-verify="maxlength" placeholder="填写撰写人"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">申请人<span style="color: red">*</span></label>
                <div class="fl">
                    <input type="text" name="spfF5" value="${formData.spfF5}" lay-maxlength="128" lay-verify="maxlength|required" placeholder="填写申请人"/>
                </div>
            </li>
            <ul id="inventor">
                <li class="clearfix inventor h34" style="width: 50%!important;">
                    <label class="fl gary">第<span class="ind">1</span>发明人<span style="color: red">*</span></label>
                    <div class="fl">
                        <input type="text" name="strList1[0]" lay-maxlength="128" lay-verify="maxlength|required" value="${famingrens[0].data1}" placeholder="填写第1发明人"/>
                        <img src="/plugin/common/images/77@2x.png" onclick="fmadd()" class="thesisimg2">
    <#--                    <img src="/plugin/common/images/76@2x.png" class="thesisimg1">-->
                    </div>
                </li>

                <#list famingrens as famingren>
                    <#if (famingren_index > 0)>
                        <li class="clearfix inventor h34" style="width: 50%!important;">
                            <label class="fl gary">第<span class="ind">${famingren_index+1}</span>发明人<span style="color: red">*</span></label>
                            <div class="fl">
                                    <input class="zb-input" type="text" name="strList1[${famingren_index}]" lay-maxlength="128" lay-verify="maxlength|required" value="${famingren.data1}" placeholder="填写第${famingren_index+1}发明人"/>
                                    <img src="/plugin/common/images/76@2x.png" onclick="fmClick(this)" class="thesisimg1">
                            </div>
                        </li>
                    </#if>
                </#list>

            </ul>
<#--            <li class="clearfix">-->
<#--                <label class="fl gary">第2发明人</label>-->
<#--                <div class="fl">-->
<#--                    <input type="text" placeholder="填写第2发明人"/>-->
<#--                    -->
<#--                    <img src="/plugin/common/images/76@2x.png" class="thesisimg1">-->
<#--                </div>-->
<#--            </li>-->
            <li class="clearfix upload-file-li h34" style="width: 50%!important;">
                <label class="fl gary">技术交底书名称</label>
                <div class="fl">
                    <input type="text" name="spfF6" value="${formData.spfF6}" lay-maxlength="128" lay-verify="maxlength" placeholder="填写技术交底书名称"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">技术交底书提交时间</label>
                <div class="fl">
                    <input type="text" name="spfF7" id="spfF7" lay-maxlength="128" lay-verify="maxlength" value="${formData.spfF7}" placeholder="填写技术交底书提交时间"/>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">技术交底书</label>
                <div class="fl upload-file-div">
                    <div>
                        <img id="file1100020001" lay-filter="file1100020001" src="/plugin/common/images/57@2x.png" class="thesisimg3 file-upload" filedata="{'type':'1100020001'}">
                        <span class="blue">上传Word</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">权利要求书名称</label>
                <div class="fl">
                    <input type="text" name="spfF8" value="${formData.spfF8}" lay-maxlength="128" lay-verify="maxlength" placeholder="请输入权利要求书名称"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">权利要求书提交时间</label>
                <div class="fl">
                    <input type="text" name="spfF9" id="spfF9" lay-maxlength="128" lay-verify="maxlength"  value="${formData.spfF9}" placeholder="请选择权利要求书提交时间" style="width:140px"/>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">权利要求书</label>
                <div class="fl upload-file-div">
                    <div>
                        <img id="file1100020002" lay-filter="file1100020002" src="/plugin/common/images/57@2x.png" class="thesisimg3 file-upload" filedata="{'type':'1100020002'}">
                        <span class="blue">上传Word</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">专利检索报告</label>
                <div class="fl upload-file-div">
                    <div>
                        <img id="file1100020003" lay-filter="file1100020003" src="/plugin/common/images/57@2x.png" class="thesisimg3 file-upload" filedata="{'type':'1100020003'}">
                        <span class="blue">上传Word</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">递交信息确认表</label>
                <div class="fl upload-file-div">
                    <div>
                        <img id="file1100020004" lay-filter="file1100020004" src="/plugin/common/images/57@2x.png" class="thesisimg3 file-upload" filedata="{'type':'1100020004'}">
                        <span class="blue">上传Pdf</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">国知局受理时间</label>
                <div class="fl">
                    <input type="text" name="spfF10" id="spfF10" lay-maxlength="128" lay-verify="maxlength" value="${formData.spfF10}" placeholder="请填写国知局受理时间"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">国知局受理通知书编号</label>
                <div class="fl">
                    <input type="text" name="spfF11" lay-maxlength="128" lay-verify="maxlength" value="${formData.spfF11}" placeholder="请填写国知局受理通知书编号" style="width:140px"/>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">受理书</label>
                <div class="fl upload-file-div">
                    <div>
                        <img id="file1100020005" lay-filter="file1100020005" src="/plugin/common/images/57@2x.png" class="thesisimg3 file-upload" filedata="{'type':'1100020005'}">
                        <span class="blue">上传Pdf</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">实审官费金额</label>
                <div class="fl">
                    <input type="text" name="spfF12" lay-maxlength="128" lay-verify="maxlength" value="${formData.spfF12}" placeholder="请填写实审官费金额"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">实审官费缴纳时间</label>
                <div class="fl">
                    <input type="text" name="spfF13" id="spfF13" lay-maxlength="128" lay-verify="maxlength" value="${formData.spfF13}" placeholder="请填写实审官费缴纳时间"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">授权登记费金额</label>
                <div class="fl">
                    <input type="text" name="spfF14" lay-maxlength="128" lay-verify="maxlength" value="${formData.spfF14}" placeholder="请填写授权登记费金额"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">授权登记费缴纳时间</label>
                <div class="fl">
                    <input type="text" name="spfF15" id="spfF15" lay-maxlength="128" lay-verify="maxlength" value="${formData.spfF15}" placeholder="请填写授权登记费缴纳时间"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">专利授权书编号</label>
                <div class="fl">
                    <input type="text" name="spfF16" lay-maxlength="128" lay-verify="maxlength" value="${formData.spfF16}" placeholder="请填写专利授权书编号"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%!important;">
                <label class="fl gary">专利授权书授权时间</label>
                <div class="fl">
                    <input type="text" name="spfF17" id="spfF17" lay-maxlength="128" lay-verify="maxlength" value="${formData.spfF17}" placeholder="请填写专利授权书授权时间"/>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">专利授权书</label>
                <div class="fl upload-file-div">
                    <div>
                        <img id="file1100020006" lay-filter="file1100020006" src="/plugin/common/images/57@2x.png" class="thesisimg3 file-upload" filedata="{'type':'1100020006'}">
                        <span class="blue">上传Pdf</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
        </ul>
        <div style="margin-top:10px;">录入年费信息</div>
        <div class="iTtable" style="margin-bottom:10px">
<#--            <table id="zltable" class="mt20" lay-filter="zltable"></table>-->
            <table id="table" border="" cellspacing="" cellpadding="">
                <tr>
                    <th style="width: 8%;">序号</th>
                    <th>金额</th>
                    <th>缴费时间</th>
                    <th>年费跨度</th>
                    <th>经办人</th>
                    <th style="width: 8%;">操作</th>
                </tr>
                <tr>
                    <td><span name="formDataList[0].data1">1</span></td>
                    <td><input name="formDataList[0].data2"/></td>
                    <td><input name="formDataList[0].data3" id="casetimeinput1"/></td>
                    <td><input name="formDataList[0].data4"/></td>
                    <td><input name="formDataList[0].data5"/></td>
                    <td><img src="/plugin/common/images/77@2x.png" onclick="addOneLine()"></td>
                </tr>
            </table>
        </div>
        <ul class="clearfix">
            <li class="clearfix" style="width: 100%">
                <label class="fl gary" style="width: 15%!important;">备注</label>
                <div class="fl beizhu-div">
                    <textarea name="spfF18" lay-maxlength="200" lay-verify="maxlength" rows="" cols="">${formData.spfF18}</textarea>
                </div>
            </li>
        </ul>
    </div>
</div>
<div class="layui-footer" style="width: 100%;text-align: center;background-color: #fff;position:fixed;bottom:0px;height: 50px;padding-top: 15px">
    <input class="layui-btn layui-btn-primary layui-btn-sm" type="button" value="关闭" onclick="_itkl.content.layerClose()">
    <input id="sub-btn" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit lay-filter="formDemo" type="button" value="确定" >
</div>
</form>
<!--JQ-->
<script type="text/javascript" charset="utf-8" src="/plugin/common/js/jquery-1.8.3.min.js"></script>
<!--公用样式JS-->
<script type="text/javascript" charset="utf-8" src="/plugin/common/js/comment.js"></script>
<!--选择城市js-->
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/it/common/js/itkl.js"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/common/js/form.file.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script type="text/html" id="zlDemo">
    <img src="/plugin/common/images/77@2x.png" tableind="{{d.LAY_TABLE_INDEX}}" sucid="{{d.sucId}}"
         class="cursor" alt="" class="delete" lay-event="del" tableid="zztable" delurl="/sys/personCenter/delCert" <#if (shenhe != '1')>onclick="delZz(this)"</#if>>
</script>
<script>
    var dicId='${dicId}';
    var formCode='${formCode}';
    var laydate;
    var temp = '${temp}';
    var fileCount = '${fileCount}';
    var edit = '${edit}';
    var deledFileIds = [];
    layui.use(['form', 'layer', 'upload', 'element', 'table'], function () {
        var form = layui.form, layer = layui.layer,table = layui.table; laydate = layui.laydate;
        laydate.render({//技术交底书提交时间
            elem: '#spfF7',
            trigger: 'click'
        })
        laydate.render({//权利要求书提交时间
            elem: '#spfF9',
        trigger: 'click'
        })
        laydate.render({//国知局受理时间
            elem: '#spfF10',
            trigger: 'click'
        })
        laydate.render({//实审官费缴纳时间
            elem: '#spfF13',
            trigger: 'click'
        })
        laydate.render({//授权登记费缴纳时间
            elem: '#spfF15',
            trigger: 'click'
        })
        laydate.render({//专利授权书授权时间
            elem: '#spfF17',
            trigger: 'click'
        })
        form.verify({
            maxlength: function (v,item) {
                var maxlength = item.getAttribute('lay-maxlength');
                if(v.trim()!=''){
                    if(v.trim().length>maxlength){
                        return "输入长度不能大于"+maxlength+"个字符！";
                    }
                }
            },
            number: function (v) {
                var reg = /^[0-9]*$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    return '请输入正确的数字';
                }
            },
            decimal: function (v) {
                var reg = /^-?([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,10})?$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    return '请输入正确的金额';
                }
            },
            perdecimal: function (v) {
                var reg = /^[1-9][0-9]*([.][0-9]+)?$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    if(v.trim()!="0"  || v.trim()!=0){
                        return '请输入数字';
                    }
                }
            }
        })


        //提交
        form.on('submit(formDemo)', function (data) {
            //取消掉确认按钮
            $('#sub-btn').attr('disabled','disabled');
            data.field.spfF29 = dicId;
            data.field.spfF30 = formCode;
            if(deledFileIds && deledFileIds.length>0){
                for(var a=0;a<deledFileIds.length;a++){
                    data.field['strList9[' + a + ']'] = deledFileIds[a];
                }
            }
            var json=data.field;
            if(json){
                layerAjax("/it/form/insertBook",json,'',function (d) {
                    if(d){
                        layer.msg(d.msg,{icon:1})
                        setTimeout(function(){
                            parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        },1000);
                    }else{
                        layer.msg(d.msg,{icon:2})
                        $('#sub-btn').removeAttr('disabled');
                    }
                })

            }
        })
    })
    function fmadd(){
        var len=$(".inventor").length;
        var num=len+1;
        $("#inventor").append('<li class="clearfix inventor h34"  style="width: 50%!important;">\n' +
            '                <label class="fl gary">第<span class="ind">'+num+'</span>发明人<span style="color: red">*</span></label>\n' +
            '                <div class="fl">\n' +
            '                    <input class="zb-input" type="text" lay-maxlength="128" lay-verify="maxlength|required" name="strList1['+len+']" placeholder="填写第'+num+'发明人"/>\n' +
            '                    \n' +
            '                    <img src="/plugin/common/images/76@2x.png" onclick="fmClick(this)" class="thesisimg1">\n' +
            '                </div>\n' +
            '            </li>');
    }
    function fmClick(b){
        $(b).parents('.inventor').remove();
        zbflushChildsInd();
    }
    function zbflushChildsInd(){
        $.each($('.inventor'),function(i,e){
            var num=i+1;
            $(e).find('.ind').text(num);
            $(e).find('.zb-input').attr('placeholder','填写第'+(num)+'发明人');
            $(e).find('.zb-input').attr('name','strList1['+i+']');
        })
    }

    function addOneLine(data){
        var data2='';var data3='';var data4='';var data5='';
        if(data && data.data2){
            data2 = data.data2;
        }
        if(data && data.data3){
            data3 = data.data3;
        }
        if(data && data.data4){
            data4 = data.data4;
        }
        if(data && data.data5){
            data5 = data.data5;
        }

        var tr_count = $('#table').find('tr').length;
        //更改最后一行的序号
        $('#table').find('tr:last').find('td:eq(0)').html(tr_count);
        //更改最后一行序号的name属性:
        $('#table').find('tr:last').find('td:eq(0)').attr('name','formDataList['+(tr_count-1)+'].data1');
        $('#table').find('tr:last').find('td:eq(1)').find('input').attr('name','formDataList['+(tr_count-1)+'].data2');
        $('#table').find('tr:last').find('td:eq(2)').find('input').attr('name','formDataList['+(tr_count-1)+'].data3');
        $('#table').find('tr:last').find('td:eq(2)').find('input').attr('id','casetimeinput'+tr_count);
        $('#table').find('tr:last').find('td:eq(3)').find('input').attr('name','formDataList['+(tr_count-1)+'].data4');
        $('#table').find('tr:last').find('td:eq(4)').find('input').attr('name','formDataList['+(tr_count-1)+'].data5');

        $('#table').find('tr:last').before('<tr>'+
            '<td><span name="formDataList['+(tr_count-2)+'].data1">'+(tr_count-1)+'</span></td>'+
            '<td><input type="text" name="formDataList['+(tr_count-2)+'].data2" lay-maxlength="128" lay-verify="maxlength" value="'+data2+'"></td>'+
            '<td><input id="casetimeinput'+(tr_count-1)+'" type="text" name="formDataList['+(tr_count-2)+'].data3" lay-maxlength="128" lay-verify="maxlength"  value="'+data3+'"></td>'+
            '<td><input type="text" name="formDataList['+(tr_count-2)+'].data4" lay-maxlength="128" lay-verify="maxlength" value="'+data4+'"></td>'+
            '<td><input type="text" name="formDataList['+(tr_count-2)+'].data5" lay-maxlength="128" lay-verify="maxlength" value="'+data5+'"></td>'+
            '<td><img src="/plugin/common/images/76@2x.png" onclick="delOneLine(this)"></td>'+
            '</tr>');

        //绑定时间控件:
        laydate.render({
            elem: '#casetimeinput'+tr_count,
            trigger: 'click',
        })

        laydate.render({
            elem: '#casetimeinput'+(tr_count-1),
            trigger: 'click',
        })

    }
    function delOneLine(e){
        $(e).parent().parent().remove();
        flushTableInd();
    }
    function flushTableInd(){
        var trs = $('#table').find('tr');
        $.each(trs,function(i,e){
            //设置序号:
            var nameInd = i-1;
            $(e).find('td:first').html(i);
            //设置name:
            $(e).find('td:eq(0)').attr('name','formDataList['+nameInd+'].data1')

            $(e).find('td:eq(1)').find('input').attr('name','formDataList['+nameInd+'].data2');
            $(e).find('td:eq(2)').find('input').attr('name','formDataList['+nameInd+'].data3');
            $(e).find('td:eq(2)').find('input').attr('id','casetimeinput'+i);
            $(e).find('td:eq(3)').find('input').attr('name','formDataList['+nameInd+'].data4');
            $(e).find('td:eq(4)').find('input').attr('name','formDataList['+nameInd+'].data5');
            laydate.render({
                elem: '#casetimeinput'+i,
                trigger: 'click'
            })
        })
    }
$(function(){

    $('input').attr('autocomplete','off');

    laydate.render({
        elem: '#casetimeinput1',
        trigger: 'click'
    })
    var tempFileIds = [];
    var uploadFileAdds = $('.file-upload');
    if(uploadFileAdds && uploadFileAdds.length>0){
        bindOneUploader(uploadFileAdds,0);
    }

    if(edit && edit == '1'){
        initFileShow();
    }

    var nianfeixinxiListStr = '${nianfeixinxis}';
    var nianfeixinxiList = eval(nianfeixinxiListStr);
    if(nianfeixinxiList && nianfeixinxiList.length>0){
        for(var a=0;a<nianfeixinxiList.length;a++){
            addOneLine(nianfeixinxiList[a]);
        }
    }
})

    function test(){
        $('input[name="spfF1"]').val("专利名称");
        $('input[name="spfF4"]').val("撰写人1");
        $('input[name="spfF5"]').val("申请人");
        $('input[name="strList1[0]"]').val("发明人1");
        $('input[name="spfF6"]').val("技术交底书名称");
        $('input[name="spfF7"]').val("2021-04-01");
        $('input[name="spfF8"]').val("技术要求书名称");
        $('input[name="spfF9"]').val("2021-04-02");
        $('input[name="spfF10"]').val("2021-04-03");
        $('input[name="spfF11"]').val("111-1111-111");
        $('input[name="spfF12"]').val("200");
        $('input[name="spfF13"]').val("2021-04-04");
        $('input[name="spfF14"]').val("300");
        $('input[name="spfF15"]').val("2021-04-05");
        $('input[name="spfF16"]').val("222-222-222");
        $('input[name="spfF17"]').val("2021-04-06");
        $('textarea').val("范围分为非挖而非挖而非");
    }

    //显示上传的文件:
    function initFileShow(){
        var uploadFileAdds = $('.file-upload');
        initOneFileShow(uploadFileAdds,0);
    }

    function initOneFileShows(d){
        alert(d);
    }

    function initOneFileShow(uploadFileAdds,i){
        var aFileUploadAdd = $(uploadFileAdds[i]);
        var fileDataStr = aFileUploadAdd.attr('filedata');
        var fileData = eval('(' + fileDataStr + ')');
        var fileContainer = aFileUploadAdd.parent().next();
        var type = fileData.type;
        layerAjaxGetIT('/it/form/getFileList',{ dicId: dicId, formFileType: type },'',uploadFileAdds,i,function (res) {
            if(res.flag){
                //显示:
                showFile(res.data,fileContainer,0);
            }
        })

    }

    function showFile(filelist,container,ind){
        if(filelist && filelist.length>0 && (ind < filelist.length)){
            var aFile = filelist[ind];
            var newFileId = aFile.id;
            var newIndex = $('.form-file-div-'+aFile.type).length*1;
            var fileName = '';
            if(aFile.type == '1100020001'){
                fileName = 'strList2';
            }else if(aFile.type == '1100020002'){
                fileName = 'strList3';
            }else if(aFile.type == '1100020003'){
                fileName = 'strList4';
            }else if(aFile.type == '1100020004'){
                fileName = 'strList5';
            }else if(aFile.type == '1100020005'){
                fileName = 'strList6';
            }else if(aFile.type == '1100020006'){
                fileName = 'strList7';
            }
            container.prepend('<div class="clearfix form-file-div form-file-div-'+aFile.type+'">\n' +
                '                            <span class="fl file-name-span">'+aFile.fileName+'</span>\n' +
                '                            <img src="/plugin/common/images/89@2x.png" class="fr cursor" onclick="_form_file.del.delReal(this,'+'&apos;'+aFile.id+'&apos;'+','+'&apos;'+aFile.type+'&apos;'+',deledFileIds)">\n' +
                '                            <input type="hidden" class="'+aFile.type+'-input" name="'+fileName+'['+newIndex+']" value="'+newFileId+'" />'+
                '                        </div>');
            ind ++;
            showFile(filelist,container,ind);
        }
    }

    //绑定上传组件单个
    function bindOneUploader(uploadFileAdds,i){
        var aFileUploadAdd = $(uploadFileAdds[i]);
        var id=aFileUploadAdd.attr('id');
        var fileDataStr = aFileUploadAdd.attr('filedata');
        var fileData = eval('(' + fileDataStr + ')');
        if(edit && edit == '1'){
            fileData['linkId'] = '${formCenterFileId}';
        }
        var fileContainer = aFileUploadAdd.parent().next();
        var type = fileData.type;
        var ext = '';
        var fileName = '';
        if(type == '1100020001'){
            ext = 'doc|docx';
            fileName = 'strList2';
        }else if(type == '1100020002'){
            ext = 'doc|docx';
            fileName = 'strList3';
        }else if(type == '1100020003'){
            ext = 'doc|docx';
            fileName = 'strList4';
        }else if(type == '1100020004'){
            ext = 'pdf';
            fileName = 'strList5';
        }else if(type == '1100020005'){
            ext = 'pdf';
            fileName = 'strList6';
        }else if(type == '1100020006'){
            ext = 'pdf';
            fileName = 'strList7';
        }
        //上传组件参数自定义:
        var uploadPara = {
            elem: '#'+id,
            accept: 'file',
            temp: temp,
            exts: ext,
            before: function(res){
                this.data = fileData;
            },
            container: fileContainer,
            fileName: fileName,
            // fileOrder: 'desc'
        };
        _form_file.upload.bind(uploadPara);
        if(i < uploadFileAdds.length-1){
            i++;
            bindOneUploader(uploadFileAdds,i);
        }
    }
</script>

</body>

</html>